package cn.com.utt.unms.service;

import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Service;
import cn.com.utt.common.exception.BusinessException;
import cn.com.utt.unms.pojo.UserRecord;
import cn.com.utt.unms.pojo.WxCode;
import cn.com.utt.unms.vo.AuthResult;

@Service
public interface JsonService {

	public WxCode checkWxIsRegin(String sn, String mac);

	// 0：失败，1:成功，2：登录次数超出限制,3：账号并发数超出限制
	int onekeyLogin(long cfgId, UserRecord record, String mac) throws BusinessException;

	// 0：失败，1:成功，2：登录次数超出限制,3：账号并发数超出限制
	int accountLogin(long userId, UserRecord record, String username, String password, String mac)
			throws BusinessException;

	// 0：密码错误，1:成功，2：登录次数超出限制，3：账号并发数超出限制
	int wxLogin(long cfgId, UserRecord record, String code, String mac) throws BusinessException;

	// 0：用户名密码错误，1:成功，2：登录次数超出限制，3：账号并发数超出限制
	int phoneLogin(long cfgId, UserRecord record, String phone, String password, String mac) throws BusinessException;

	// 0：用户名密码错误，1:成功，2：登录次数超出限制，3：账号并发数超出限制
	int phoneLogin(long cfgId, UserRecord record, String phone, String mac) throws BusinessException;

	int checkPhoneIsRegin(String phone, long cfgId, String mac) throws BusinessException;

	int phoneRegin(String phone, long userId,HttpSession session) throws BusinessException;
	
	public AuthResult authAvailable(String deviceid, String mac, String token) throws BusinessException;

}